FROM php:5.6-cli-jessie

COPY ./sources.list.jessie /etc/apt/sources.list

## Update Ubuntu
RUN apt-get update

## mcrypt   gd
RUN apt-get install -y libmcrypt-dev   libfreetype6-dev libjpeg62-turbo-dev libpng-dev \
&&  docker-php-ext-configure mcrypt \
&&  docker-php-ext-install -j$(nproc)  mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/  \
&& docker-php-ext-install -j$(nproc) gd

## Intl
# RUN apt-get install -y libicu-dev
# RUN docker-php-ext-install -j$(nproc) intl

## General
RUN docker-php-ext-install zip   pcntl pdo_mysql   mysqli

# Required by cron
RUN apt-get install -y cron  \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#job file
ADD crontab /etc/cron.d/cron

RUN mkdir /var/log/cron  \
    && touch /var/log/cron/cron.log \
  && chmod 0644 /etc/cron.d/cron \
  && crontab /etc/cron.d/cron
CMD ["cron", "-f"]
